package org.hw.service.impl;

import org.hw.entity.Monitordata;
import org.hw.mapper.MonitordataMapper;
import org.hw.service.MonitordataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MonitordataServiceImpl extends ServiceImpl<MonitordataMapper, Monitordata> implements MonitordataService {

    @Autowired
    private MonitordataMapper monitordataMapper;

    @Override
    public boolean saveMonitorData(Monitordata data) {
        // 设置当前时间作为创建时间
        long currentTime = System.currentTimeMillis();
        data.setCreateTime(currentTime);
        data.setUpdateTime(currentTime);
        data.setState(1); // 设置状态为未删除

        return save(data);
    }
}
